<?php
error_reporting(E_ALL);
require "user/User.php";
require "user/UserVip.php";
require "user/UserCor.php";
require "product/Dog.php";
$dog = new Dog();

$userId = 101;
$user = new User($userId);

$user->delegator = new UserVip($userId);

echo "<div>";
echo "VIP用户狗的价格是：".$dog->getPrice() * $user->getVipDiscount();
echo "</div>";

echo "<hr />";

$user->delegator = new UserCor($userId);

echo "<div>";
echo "第三方用户狗的价格是：".$dog->getPrice() * $user->getCorDiscount();
echo "</div>";